package com.qf.nz.consumer.controller;

import com.qf.nz.provider.service.StudentService;
import com.qf.nz.vo.VO;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 2020/2/11
 * 郭程鹏
 * NZ-20-Dubbo
 * 面向代码面向君,不负时光不负卿
 */
@RestController
public class StudentController {
    //注入注册中心的接口 版本       重试次数     超时时间
    @Reference(version = "1.0.0",retries = 0,timeout = 10000)
    private StudentService studentService;

    @RequestMapping("studentList.html")
    public VO studenHtml(){
        VO vo = studentService.selectStudentList();
        return vo;
    }

    @RequestMapping("student.html")
    public VO studenHtml(Integer id){
        VO vo = studentService.selectStudent(id);
        return vo;
    }
}
